<template>
  <div class="side-nav">
    <el-menu router :default-active="activeIndex">
      <el-menu-item :index="type == 5 ? 'micro-info' : 'training-info'">
        <span slot="title">基本信息</span>
      </el-menu-item>
      <el-menu-item :index="type == 5 ? 'micro-chapter' : 'training-chapter'">
        <span slot="title">章节管理</span>
      </el-menu-item>
      <el-menu-item :index="type == 5 ? 'material-file' : 'training-file'">
        <span slot="title">素材附件管理</span>
      </el-menu-item>
      <el-menu-item v-if="type == 6" index="trainees-class">
        <span slot="title">学员管理</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>
<script>
export default {
  data() {
    return {
      activeIndex: 'micro-info',
      type: this.$route.meta.type,
    }
  },
  mounted() {
    this.activeIndex = this.type == 5 ? 'micro-info' : 'training-info'
  },
  methods: {},
}
</script>
<style scoped>
.side-nav {
  height: 800px;
}
.side-nav >>> .el-menu {
  border-right: 0 none;
}
.side-nav .el-menu-item {
  height: 40px;
  line-height: 40px;
  border-bottom: 1px solid #ededed;
}
.side-nav .el-menu-item.is-active {
  color: var(--colorA1);
  background-color: var(--colorHover1);
}
</style>